CURRENT = $(shell uname -r)
KDIR = /lib/modules/$(CURRENT)/build
TARGET = LynxTrig_RT
OBJS = LynxTrig.o ChanMapper.o bigcontarea.o smalloc.o ../../kernel/softtask.o
MDIR = rtai
RTAIDIR = /usr/realtime
COMEDIDIR = /usr/src/comedi
PWD = $(shell pwd)
DEST = /lib/modules/$(CURRENT)/kernel/$(MDIR)
EXTRA_CFLAGS += -DEXPORT_SYMTAB $(shell $(RTAIDIR)/bin/rtai-config --module-cflags)  -I$(src)/../../include -I$(src)/../../kernel -I$(COMEDIDIR)/include -I$(src)/LynxTWO-RT -DRTAI 
MACH = $(shell uname -m)

ifeq ($(MACH), x86_64)
# workaround for kernel build system sometimes addind -mno-see and -mno-sse2 which messes up our
# use of floats in the kernel
EXTRA_CFLAGS += -msse -msse2
endif

obj-m      := $(TARGET).o
$(TARGET)-y  := $(OBJS)

-include $(KDIR)/Rules.make
